#pragma once

#include "registry.h"

#define CFG_DESCRIPTION_LENGTH 128

#define CONFIG_SAVE 0
#define CONFIG_LOAD 1
#define CONFIG_SAVE_FULL 2
#define CONFIG_LOAD_FULL 3
#define CONFIG_DELETE 4

void WIN32GUI_LoadUIString(DWORD id, TCHAR* string, DWORD dwStringLen);
extern int DiskSelection(HWND hDlg, WPARAM wParam, int flag, CConfiguration* prefs, TCHAR*);
void InitializeListView(HWND hDlg);
extern void pre_gui_message(const TCHAR*, ...);
extern void gui_message_id(int id);
int dragdrop(HWND hDlg, HDROP hd, CConfiguration* prefs, int currentpage);
UAEREG* read_disk_history(int type);
void write_disk_history();

struct newresource
{
    LPCDLGTEMPLATEW resource;
    HINSTANCE inst;
    int size;
    int tmpl;
    int width, height;
};

extern struct newresource* scaleresource(struct newresource* res, HWND);
extern void freescaleresource(struct newresource*);
extern void scaleresource_setmaxsize(int w, int h);
extern HWND CustomCreateDialog(int templ, HWND hDlg, DLGPROC proc);
extern INT_PTR CustomDialogBox(int templ, HWND hDlg, DLGPROC proc);
extern struct newresource* getresource(int tmpl);
extern struct newresource* resourcefont(struct newresource*, TCHAR* font, int size);

void gui_message(const TCHAR*, ...);
int gui_message_multibutton(int flags, const TCHAR* format, ...);

extern CArray<newresource*, newresource*>resources;